package com.sms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sms.mapper.SuppliedProductsMapper;
import com.sms.pojo.SuppliedProducts;
import com.sms.service.SuppliedProductsService;
import com.sms.util.SqlSessionFactoryUtil;
import lombok.Getter;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

@Getter
public class SuppliedProductsServiceImpl extends ServiceImpl<SuppliedProductsMapper, SuppliedProducts> implements SuppliedProductsService {

    SqlSession sqlSession=null;

    @Override
    public SuppliedProductsMapper getBaseMapper() {
        SqlSessionFactory factory = SqlSessionFactoryUtil.getFactory();
        sqlSession=factory.openSession(true);
        SuppliedProductsMapper mapper = factory.getConfiguration().getMapper(SuppliedProductsMapper.class, sqlSession);
        return mapper;
    }

    @Override
    public List<SuppliedProducts> listSuppliedProducts() {
        return this.getBaseMapper().listSuppliedProducts();
    }

}
